package com.hmdp.utils;

/**
 * ClassName: ILock
 * Package: com.hmdp.utils
 * Description:
 *
 * @Author:
 * @Create: 2024/5/5 - 22:19
 * @Version: v1.0
 */
public interface ILock {

    /**
     * 尝试获取锁
     * @param timeoutSec 锁的过期时间，到期就自动释放
     * @return true代表获取锁成功， false代表获取锁失败
     */
    boolean tryLock(long timeoutSec);

    /**
     * 释放锁
     */
    void releaseLock();
}
